{% load custom_filters %}
<!DOCTYPE html>
<html>
<head>
    <title>计算结果</title>
    <style>
        table { width: 100%; border-collapse: collapse; margin-top: 20px; }
        th, td { border: 1px solid #ddd; padding: 8px; text-align: center; }
        th { background-color: #f2f2f2; }
    </style>
</head>
<body>
    <h1>计算结果</h1>
    <a href="{% url 'myweb:home' %}">← 返回重新计算</a>
    <div style="margin: 20px 0;">
        {{ svg_plot|safe }}
    </div>

    <table>
        <thead>
            <tr>
                <th>t</th>
                {% for var in variables %}
                    <th>{{ var }}(t)</th>
                {% endfor %}
            </tr>
        </thead>
        <tbody>
            {% for row in table_data %}
                <tr>
                    <td>{{ row.t|floatformat:3 }}</td>
                    {% for var in variables %}
                        <td>{{ row|get_item:var|floatformat:6 }}</td>
                    {% endfor %}
                </tr>
            {% endfor %}
        </tbody>
    </table>
</body>
</html>